# _*_ coding : utf-8 _*_
# @Time: 2024/10/11 11:33
# @Author : 石文帅	
# @File : testcase04签到记录.py
# @Project : python_slfh

from server.slfhWorkbench import *
from selenium.webdriver.chrome.service import Service
from xpathDictionary.slfhXpath import *


class test(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls.wd = webdriver.Chrome(service=Service(driver_path))
        cls.wd.get(url_path)
        cls.wd.maximize_window()
        login(cls.wd)

    @classmethod
    def tearDownClass(cls):
        cls.wd.quit()
        log.info('----------------------------------------------------------')

    def testcase04签到记录(self):
        """
        签到记录
        :return:
        """
        log.info('test4_签到记录搜索')
        search_menu(self.wd, '签到记录')
        locate_input(self.wd, sign_record['签到人员搜索框'], '张三')
        locate_click(self.wd, sign_record['时间筛选'])
        locate_input(self.wd, sign_record['开始时间'], '2024-09-13')
        locate_input(self.wd, sign_record['结束时间'], '2024-09-13')
        locate_click(self.wd, sign_record['时间筛选确认'])
        log.info('断言搜索的数据准确性')
        actualise = ['张三', '重庆市渝北区大竹林街道G75兰海高速重庆市计量质量检测研究院(杨柳北路)', '2024-09-13 17:19:20']
        assert_list_elements(self.wd, sign_record['签到列表第一条'], actualise)
